package B;

import java.util.Arrays;
import java.util.Comparator;

public class a {
    static Comparator<Integer> c=new Comparator<Integer>() {

        public int compare(Integer o1, Integer o2) {
            return o2 - o1;
        }
    };
    public static void main(String[] args) {
        Integer[] arr={1,5,6,3,4};
        Arrays.sort(arr, new Comparator<Integer>() {
            @Override
            public int compare(Integer o1, Integer o2) {
                return o2-o1;
            }
        });
        System.out.println(Arrays.toString(arr));

//        Arrays.sort(arr, new Comparator<int[]>() {
//            @Override
//            public int compare(int[] o1, int[] o2) {
//                int a = o1[1] + o1[2] * 2;
//                int b = o2[1] + o2[2] * 2;
//                if(a == b) return o1[0] - o2[0];
//                return b - a;
//            }
//        });
    }
}
